package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class NoteTest {
    public static void main(String[] args) throws IOException {


        FileOutputStream fos = new FileOutputStream("./note.txt", true);

        Scanner s = new Scanner(System.in);
        System.out.println("请开始输入");

        while (true) {
            String line = s.next();
            if ("exit".equalsIgnoreCase(line)) {
                System.out.println("退出程序");
                break;
            }
            fos.write(line.getBytes(StandardCharsets.UTF_8));

        }
        fos.close();


    }
}
